package mode23.adapter;

/**
 * 适配器
 */
public class DeviceAdapter extends OldDevice implements NewInterface{

    private OldDevice oldDevice;

    public DeviceAdapter(OldDevice oldDevice) {
        this.oldDevice = oldDevice;
    }

    @Override
    public void newMethod() {
        oldDevice.oldMethod();  // 适配器调用旧设备的方法
    }
}
